home *** CD-ROM | disk | FTP | other *** search
-
- /*
- NEW CONSTANTS for PreviewBook Servlet
-
- 0 - Preview
- 1 - Page ---- '/corsair/isbn/$isbn/temp/page'
- 2 - TOC ---- '/corsair/isbn/$isbn/temp/toc'
- 3 - Media Library ---- '/corsair/isbn/$isbn/temp/medialibrary'
- 4 - Glossary ------ '/corsair/isbn/$isbn/temp/glossary'
- 5 - Asset (jpg , gif)------ *directory will be passed from the href in 'url' variable
- 6 - Asset (images with cations stored in ASSETHTML folder)
- 7 - Asset (Web) ----- * will be in the form of http:// .....
- 8 - Asset (rm) ---- *
- 9 - Asset (swf)
- 10 - Hint ---- '/corsair/isbn/$isbn/temp/hint'
-
- */
- //alert(servletName);
- /*called for hint window through the servlet*/
-
- function openHintWindow(isbn, page ) {
- var url = servletName+"?ACTION=11&FILE=" + escape(page)+".html&ISBN="+isbn;
- var width = getWidth(600);
- var height = 420;
- var features = "scrollbars,top=0,left=0,width=" + width + ",height=" + height;
- window.open(url, 'Hint', features, true).focus();
- }
-
- /*called for webLinks*/
- function openWebWindow( url, width, height ) {
- var features = "menubar,toolbar,location,status,scrollbars,resizable";
- if ( document.layers ) {
- /* adjust for Netscape Navigator chrome size */
- features += ",width=" + (width - 12) + ",height=" + (height - 215);
- } else {
- /* adjust for Internet Explorer chrome size */
- features += ",width=" + (width - 12) + ",height=" + (height - 165);
- }
- // openWindow( url, "Asset", features, true );
- window.open(url, 'Asset', features, true).focus();
- }
-
-
- function openMarginalWindow( isbn, marginalId, width, height ) {
- if ( width < 100 ) {
- width = 100;
- } else {
- width = getWidth( width );
- }
- if ( height < 100 ) {
- height = 100;
- }
- // var url = "/BookController?ACTION=3&ISBN=" + isbn + "&TITLE=" + title + "&ID=" + marginalId;
- var url = servletName+"?ACTION=3&FILE="+marginalId+".html&ISBN="+isbn;
- var win = window.open(url,"Marginal","scrollbars,resizable",false);
- win.resizeTo( width, height );
- win.moveTo( 0, 0 );
- win.focus();
- }
-
-
- function openPictureWindow( isbn, assetId, width, height ) {
- if ( width < 100 ) {
- width = 100;
- } else {
- width = getWidth( width );
- }
- if ( height < 100 ) {
- height = 100;
- } else {
- height += 90;
- }
-
- var url =servletName+"?ACTION=5&FILE=/corsair/isbn/"+isbn+"/temp/assethtml/"+assetId+".html";
- var win = window.open(url,"Asset","scrollbars,resizable",true);
- win.resizeTo( width, height );
- win.moveTo( 0, 0 );
- win.focus();
- }
-
- function openTableContentWnd( nodeid ,isbn) {
- var url = servletName+"?ACTION=1&FILE=";
- if(nodeid == "0") {
- url = url + "toc/tocmain.html";
- }
- else {
- url = url +"toc/"+ nodeid + ".html";
- }
- url =url+"&ISBN="+isbn;
- var width = getWidth(500);
- var height = 495;
- var features = "scrollbars,top=0,left=0,width=" + width + ",height=" + height;
- window.open(url, 'Contents', features, true).focus();
- }
-
- function openGlossaryWnd(word, language,isbn) {
- var url = servletName+"?ACTION=2&FILE=" + language + "/";
-
- if (word == "default") {
- url = url + "a.html";
- } else {
- url = url + word+".html";
- }
- url =url+"&ISBN="+isbn;
- var width = getWidth( 450 );
- var height = 200;
- var features = "scrollbars,top=0,left=0,width=" + width + ",height=" + height;
- window.open(url, "Glossary", features, true).focus();
- }
-
- function openAssetHtmlWindow( isbn, marginalId, features, width, height ) {
- if ( width < 100 ) {
- width = 100;
- } else {
- width = getWidth( width );
- }
- if ( height < 100 ) {
- height = 100;
- }
-
- var url = servletName+"?ACTION=12&FILE="+marginalId+".html&ISBN="+isbn;
- var win = window.open(url,"Asset",features,false);
- win.resizeTo( width+120, height+120 );
- win.moveTo( 0, 0 );
- win.focus();
- }
-
- function openAssetWindow( url, features, width, height ) {
-
- if ( width < 100 ) {
- width = 100;
- } else if ( ( features == "scrollbars" ) || ( features == "resizable,scrollbars" ) ) {
- width = getWidth( width );
- height = getHeight( height );
- }
- if ( height < 100 ) height = 100;
- if (width <= 770) width = width + 22;
- if (height <= 565) height = height + 35;
- var win = window.open(url,'Asset',features,true);
- win.resizeTo( width, height );
- win.moveTo( 0, 0 );
- win.focus();
- }
-
- function openAnswerWindow( isbn, text )
- {
- openMarginalWindow( isbn, text, "Answer", 370, 190 );
- }
-
- function openMediaLibraryWnd( nodeid,isbn )
- {
- var url = servletName+"?ACTION=13&FILE="+nodeid;
- url =url+"&ISBN="+isbn;
- var width = getWidth(500);
- var height = 495;
- var features = "scrollbars,top=0,left=0,width=" + width + ",height=" + height;
- var win = window.open(url, 'MediaLibrary', features, false);
- }
-
- function openBookResourceWnd( nodeid,isbn )
- {
- var url = servletName+"?ACTION=9&FILE="+nodeid+".html";
- url =url+"&ISBN="+isbn;
- var width = getWidth(600);
- var height = 550;
- var features = "scrollbars,top=0,left=0,width=" + width + ",height=" + height;
- window.open(url, 'BookResources', features, true).focus();
- }
-
- function isValidPage( isbn, page )
- {
- if ( sample ) {
- openSampleMsgWindow();
- return false;
- }
- var hasChars = ( page.toLowerCase() != page.toUpperCase() );
- var regexp = new RegExp( "_" + page + "_", "i" );
- var validPage = false;
- if ( hasChars ) {
- validPage = regexp.test( charPages );
- } else {
- validPage = ( page >= minPage ) && ( page <= maxPage ) && !regexp.test( gapPages );
- }
- if ( !validPage ) {
- openErrorWnd( isbn, page );
- }
- return validPage;
- }
-
-
- // compensate for IE scollbar width
- function getWidth( width ) {
- if ( !document.layers ) {
- width += 28;
- }
- return width;
- }
-
-
- function getHeight( height ) {
- if ( !document.layers ) {
- height += 35;
- } else {
- height += 13;
- }
- return height;
- }
-
- function TWE(tweisbn, twepagenum)
- {
-
- if(tweisbn != ''){
- // if (window.opener != null){
- // userType = window.opener.document.onlinecontent.userType.value;
- //userType = 1;
- //alert(userType);
- if ((userType== 1) || (userType== 3) || (userType== 6) || (userType== 8) || (userType== 10) ){
- document.write("<a href='javascript:void(0);' onclick=\"javascript:openTWEPage('"+tweisbn+"','"+twepagenum+"')\">");
- //document.write("<img src='../../../../generic/images/page/teachereditionicon.gif' alt='Teacher Edition' border='0'/>");
- document.write("</a>");
- // }
- }
- }
- }
-
-
- function TWEPDF(tweisbn, twepagenum, fileexnt)
- {
- if(tweisbn != ''){
- userType = 1;
- if ((userType== 1) || (userType== 3) || (userType== 6) || (userType== 8) || (userType== 10) ){
- document.write("<a href='javascript:void(0);' onclick=\"javascript:openTWEPDFPage('"+tweisbn+"','"+twepagenum+"','"+fileexnt+"' )\">");
- //document.write("<img src='../../../../generic/images/page/teachereditionicon.gif' alt='Teacher Edition' border='0'/>");
- document.write("</a>");
- }
- }
- }
-
-
- function openTWEPDFPage(tweisbn, twepagenum, fileexnt)
- {
- var features = "toolbar=no,scrollbars=yes,left=0,top=0,resizable=no,width=600,height=540";
- var url = servletName+"?ACTION=0&ISBN="+tweisbn+"&FILE="+twepagenum+"."+fileexnt;
- var win = window.open(url,"TeachEdition",features,true);
- win.moveTo( 0, 0 );
- win.focus();
- }
-
-
- function openTWEPage(tweisbn, twepagenum)
- {
- var features = "toolbar=no,scrollbars=yes,left=0,top=0,resizable=no,width=241,height=540";
- var url = servletName+"?ACTION=0&ISBN="+tweisbn+"&FILE="+twepagenum+".html";
- var win = window.open(url,"TeachEdition",features,true);
- win.moveTo( 0, 0 );
- win.focus();
- }
-
- function openAssessmentWnd(assessname, foldername, isbn)
- {
- var url = servletName +"?ACTION=7&FILE=" + foldername + "/" + assessname + ".html&ISBN="+isbn;
- var features = 'width=' + getWidth(500) + ',height=' + 495 + ',scrollbars,menubar,toolbar';
- window.open(url, 'Assessment', features, true ).focus();
- }
-
- function openMathKeyWnd()
- {
- var url = servletName +"?ACTION=0&FILE=temp.html";
- var features = 'width=' + getWidth(480) + ',height=' + 550 + ',scrollbars=no,titlebar=no,toolbar=no';
- window.open(url, 'MathKeyPad', features, true ).focus();
- }
-
- function onMessage1(data)
- {
- var imgs = document.images;
- for(var i=0; i < imgs.length; i++ )
- if(imgs[i].name == 'Q40A10')
- {
- var filename = "C:\\mkp\\images\\"+data;
- imgs[i].src = filename;
- }
- }